;(function () {


    const template = ` <tr>
                            <td>{{ emp.id }}</td>
                            <td>{{ emp.name }}</td>
                            <td>{{ emp.salary }}</td>
                            <td >
                            <a  href="#"  @click="deleteElemp">删除</a></td>
                        </tr>`;

    window.Item = {
        template,
        // 使用对象的形式接受父组件的内容
        props: {
            emp: {
                type: Object,
                required: true
            },
            deleteEmp: Function,
            index: Number
        },
        methods: {
            deleteElemp() {
                this.deleteEmp(this.index)
            }
        }
    }


})();
